//+------------------------------------------------------------------+ //| OnChart Rsi.mq4 | //| mladen | //| | //+------------------------------------------------------------------+ #property copyright "mladen" #property link "" #property indicator_chart_window #property indicator_buffers 4 #property indicator_color1 Gray #property indicator_color2 Gray #property indicator_color3 Gray #property indicator_color4 DarkOrange #property indicator_width4 2 #property indicator_style1 STYLE_DOT //---- parameters // // // // extern int RSIPeriod = 14; extern int RSIPriceType = 0; extern int maPeriod = 20; extern int maMethod = 1; extern int maPrice = 0; extern int overBought = 80; extern int overSold = 20; extern string timeFrame = "Current time frame"; //---- buffers // // // // double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; datetime RTimeArray[]; datetime TTimeArray[]; int TimeFrame; int atrTimeFrame; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer(1,ExtMapBuffer2); SetIndexBuffer(2,ExtMapBuffer3); SetIndexBuffer(3,ExtMapBuffer4); TimeFrame = stringToTimeFrame(timeFrame); atrTimeFrame=PERIOD_D1; if (TimeFrame >= atrTimeFrame) switch (TimeFrame) { case PERIOD_D1: atrTimeFrame = PERIOD_W1; break; default: atrTimeFrame = PERIOD_MN1; } return(0); } int deinit() { return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { double maValue; double avgRange; double rsiValue; int counted_bars=IndicatorCounted(); int limit; int i,r,y; //---- if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; limit=MathMax(Bars-counted_bars,TimeFrame/Period()); ArrayCopySeries(RTimeArray ,MODE_TIME ,NULL,atrTimeFrame); ArrayCopySeries(TTimeArray ,MODE_TIME ,NULL,TimeFrame); //---- // // // // for (i=0,r=0,y=0;i= 0) { char = StringGetChar(s, lenght); // // // // // if((char > 96 && char < 123) || (char > 223 && char < 256)) s = StringSetChar(s, lenght, char - 32); else if(char > -33 && char < 0) s = StringSetChar(s, lenght, char + 224); // // // // // lenght--; } // // // // // return(s); }